<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 异步任务
    // 1. 事件  ajax  计时器/延时器
    // 2. Promise对象() then  catch()



    // 1 2 5  


    console.log(1);

    var p = new Promise(function (resolve, reject) {
        console.log(2);
        resolve(3);
    })

    p.then(function (arg) {
        console.log(arg);
    })

    setTimeout(function () {
        console.log(4);
    }, 0)

    console.log(5);



</script>

</html>